import request from '@/utils/request'

export default{

    // 1.讲师列表 条件查询带分页
    getTeacherListPage(current,limit,teacherQuery){
        return request({
            url: `/eduservice/teacher/pageTeacherCondition/${current}/${limit}`,
            method: 'post',
            // 后端使用RequestBody获取数据 将对象装换为json传递
            data:teacherQuery
          })
    },

    // 2.添加讲师
    addTeacher(teacher){
        return request({
            url: `/eduservice/teacher/addTeacher`,
            method: 'post',
            // 后端使用RequestBody获取数据 将对象装换为json传递
            data:teacher
         })
    },
    // 删除讲师
    deleteTeacherById(id){
        return request({
            url: `/eduservice/teacher/${id}`,
            method: 'delete'
          })
    },
    // 根据id查询讲师
    getTeacherById(id){
        return request({
            url: `/eduservice/teacher/selectTeacher/${id}`,
            method: 'get'
          })
    },
    // 修改讲师
    updateTeacher(teacher){
        return request({
            url: `/eduservice/teacher/updateTeacher`,
            method: 'post',
            data:teacher
          })
    }
}
